﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using Clipping.Infrastructure.Models;

namespace ClippingMaster
{
  public   class SameNewsConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value is NewsModel)
            {
                NewsModel news = value as NewsModel;
                if (news.HasUnretrivedSameNews && news.News.SameNewsCount > 0)
                    return string.Format("{0}条相同新闻", news.News.SameNewsCount);
                else
                    return null;
            }
            else
            {
                return null;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
